package com.rw.map.model;

import java.io.Serializable;

/**
 * 
 * @author forest
 *
 */
public class Result implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public Result(Integer code, String message, Object data) {
		this.code = code;
		this.message = message;
		this.data = data;
	}
	private Integer code;
	
	private String message;
	
	private Object data;

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	public static Result success() {
		return new Result(0, "成功", null);
	}
	
	public static Result success(Object data) {
		return new Result(0, "成功", data);
	}
	
	public static Result failed() {
		return new Result(1, "失败", null);
	}
	
	public static Result failed(String msg) {
		return new Result(1, msg, null);
	}
	
}
